package com.hdax.dm.mapstrucs;

import com.hdax.dm.dto.ItemCinemaDto;
import com.hdax.dm.dto.ItemDto;
import com.hdax.dm.entity.item.DmItem;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;

import java.util.List;

@Mapper(componentModel = "spring")
public abstract class ItemCinemaDtoMapper {

    @Mappings({
            @Mapping(source = "startTime", target = "startDate"),
            @Mapping(source = "endTime", target = "endDate")
    })

    public abstract ItemCinemaDto toTarget(DmItem item);

    public abstract List<ItemCinemaDto> toTargets(List<DmItem> itemList);
}
